package ControlLayer;
import java.util.ArrayList;
import ModelLayer.*;

/**
 * Controller class for the address book
 * 
 * @author (Danny Melsen, Kasper S. Kristensen) 
 * @version (06-11-12)
 * (FEN): 2006.03.21: Some changes to the architecture in order to assure layering
 *                    and loose coupling
 */
public class AddressCtr
{
    private AddressBook addrBook;
    //declare instance variables to reference containers
    //passed as arguments from the main class

    //Address container is to be passed as parameter from the main controller
    public AddressCtr()
    {
    }
    
    //Dummy implementation: after implementing the model layer 
    //objects of class Person are to be returned, not String
    public Person findPerson(long id)
    {
        Person person;
        person = addrBook.findPerson(id);
        return person;
    }
    
    
    public void addPerson(Person person)
    {
        addrBook.addPerson(person);
    }
    public void deletePerson(Person person)
    {
        addrBook.deletePerson(person);  
    }
    
    public void updatePerson(long id, String address, String city, String name, String phone, String postalCode)
    {
        addrBook.updatePerson(id, address, city, name, phone, postalCode);
    }
    
    public void listAllPersons()
    {
          addrBook.listOfAllPersons();
    }
}
